var salesOrder = {
	add : function() {
		new WindowPanel(
				{
					id : 'saveSalesOrder',
					title : '新增销售订单',
					width : 710,
					height : 440,
					closeConfirm : true,
					maximizable : false,
					html : '<iframe name="salesOrderSaveFrame" id="salesOrderSaveFrame" src="'
							+ projectName
							+ '/sales/salesOrder/toSave.t4m?'
							+ getFlushParam('saveSalesOrder')
							+ '" frameborder="0" scrolling="auto"></iframe>',
					tbar : new Toolbar(
							{
								icon : 'image/op.gif',
								items : [ {
									type : 'button',
									text : '保存',
									position : {
										a : '-80px 0px',
										b : '-80px -120px'
									},
									handler : function() {
										if (getFrame('salesOrderSaveFrame')
												.validate()) {
											submitFrameForm(
													'salesOrderSaveFrame',
													'salesOrderForm');
										}
									}
								} ]
							})
				});
	},
	update : function(id) {
		new WindowPanel(
				{
					id : 'updateSalesOrder',
					title : '修改销售订单',
					width : 710,
					height : 440,
					closeConfirm : true,
					maximizable : false,
					html : '<iframe name="salesOrderUpdateFrame" id="salesOrderUpdateFrame" src="'
							+ projectName
							+ '/sales/salesOrder/toUpdate.t4m?'
							+ getFlushParam('updateSalesOrder')
							+ '&salesOrderId='
							+ id
							+ '" frameborder="0" scrolling="auto"></iframe>',
					tbar : new Toolbar({
						icon : 'image/op.gif',
						items : [ {
							type : 'button',
							text : '保存销售订单',
							position : {
								a : '-80px 0px',
								b : '-80px -120px'
							},
							handler : function() {
								submitFrameForm('salesOrderUpdateFrame',
										'salesOrderForm');
							}
						} ]
					})
				});
	},
	view : function(id) {
		new WindowPanel(
				{
					id : 'viewSalesOrder',
					title : '查看销售订单',
					width : 710,
					height : 440,
					closeConfirm : true,
					maximizable : false,
					html : '<iframe name="salesOrderViewFrame" id="salesOrderViewFrame" src="'
							+ projectName
							+ '/sales/salesOrder/toView.t4m?'
							+ getFlushParam('viewSalesOrder')
							+ '&salesOrderId='
							+ id
							+ '" frameborder="0" scrolling="auto"></iframe>'
				});
	},
	out : function(id) {
		new WindowPanel(
				{
					id : 'salesOrderOut',
					title : '销售订单出库',
					width : 800,
					height : 440,
					closeConfirm : true,
					maximizable : false,
					html : '<iframe name="salesOrderOutFrame" id="salesOrderOutFrame" src="'
							+ projectName
							+ '/sales/salesOrder/toOutWareHouse.t4m?'
							+ getFlushParam('salesOrderOut')
							+ '&salesOrder.id='
							+ id
							+ '" frameborder="0" scrolling="auto"></iframe>',
					tbar : new Toolbar({
						icon : 'image/op.gif',
						items : [ {
							type : 'button',
							text : '保存',
							position : {
								a : '-80px 0px',
								b : '-80px -120px'
							},
							handler : function() {
								submitFrameForm('salesOrderOutFrame',
										'salesOrderOutForm');
							}
						} ]
					})
				});
	},
	choose : function() {
		openCenterWindow({
			url : projectName + '/sales/salesOrderProduct/choose.t4m',
			width : 600,
			height : 400
		});
	}
};